home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / GBOXSAVE.DMO < prev    next >
Text File  |  1996-07-04  |  4KB  |  108 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1996-06-14 ╟─╖
  5.  │  │ FILE NAME   GBOXSAVE.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20. %ENTER_key  = &h000D : %ESC_key    = &h001B : %SPACE_key  = &h0020
  21. %HOME_key   = &h4700 : %UP_key     = &h4800 : %PGUP_key   = &h4900
  22. %LEFT_key   = &h4B00 :                      : %RIGHT_key  = &h4D00
  23. %END_key    = &h4F00 : %DOWN_key   = &h5000 : %PGDN_key   = &h5100
  24. %CTRL_HOME  = &h7700 : %CTRL_UP    = &h8D00 : %CTRL_PGUP  = &h8400
  25. %CTRL_LEFT  = &h7300 :                      : %CTRL_RIGHT = &h7400
  26. %CTRL_END   = &h7500 : %CTRL_DOWN  = &h9100 : %CTRL_PGDN  = &h7600
  27.  
  28. $INCLUDE "DAS-NB01.INC"
  29. $INCLUDE "DAS-NB02.INC"
  30. $INCLUDE "DAS-NBV1.INC"
  31. $INCLUDE "DAS-NBV2.INC"
  32.  
  33. CLS
  34. SCREEN 12
  35. GraphicSetup
  36.  
  37. 'TempFile% = fGwndoSETUP%( "", 9 )   ' this really isn't necessary
  38. 'IF TempFile% = 0 THEN GOTO BYEBYE   ' but can be used
  39.  
  40. FOR Col% = 0 TO 639 STEP 40
  41.   Rcol% = Col% + 39
  42.   FOR Row% = 0 TO 479 STEP 40
  43.     INCR Attr?
  44.     IF Attr? = 16 THEN Attr? = 1
  45.     Brow% = Row% + 39
  46.     GBoxDRAW Col%,Row%,Rcol%,Brow%,0,3,15
  47.     PAINT (Col%+2, Row%+2), Attr?, 15
  48.   NEXT
  49. NEXT
  50. GBoxDRAW 1, 1, 638, 478, 0, 3, 15
  51.  
  52. Wndo% = fGBoxSAVE%( 8, 16, 250, 111 )
  53.  
  54. GBoxBEVEL 8, 16, 250, 111, 5, 0, 7, 8
  55. GBoxDRAW  8, 16, 250, 111, 0, 3, 0
  56. LOCATE 3, 4 : PRINT "This is a movable test box."
  57. LOCATE 4, 4 : PRINT "Use the arrow keys to move."
  58. LOCATE 5, 4 : PRINT "  PRESS <SPACE> TO PLACE   "
  59. LOCATE 6, 4 : PRINT "    PRESS <ESC> TO QUIT    "
  60. Lcol% =  8 : MaxX% = 398 : X% = 0
  61. Trow% = 16 : MaxY% = 384 : Y% = 0
  62.  
  63. DO
  64.   IF X% <> 0 THEN
  65.     INCR Lcol%, X%
  66.     Lcol% = MIN%( MaxX%, MAX%( 1, Lcol% ) )
  67.     X% = 0
  68.   END IF
  69.   IF Y% <> 0 THEN
  70.     INCR Trow%, Y%
  71.     Trow% = MIN%( MaxY%, MAX%( 1, Trow% ) )
  72.     Y% = 0
  73.   END IF
  74.   Rcol% = Lcol% + 242
  75.   Brow% = Trow% +  95
  76.   GBOXdraw Lcol%, Trow%, Rcol%, Brow%, &hCCCC, 2, 15
  77.   G% = fAnyKey%
  78.   GBOXdraw Lcol%, Trow%, Rcol%, Brow%, &hCCCC, 2, 15
  79.   SELECT CASE G%
  80.     CASE %HOME_key , 55 : Y% = -1 : X% = -1
  81.     CASE %UP_key   , 56 : Y% = -1
  82.     CASE %PGUP_key , 57 : Y% = -1 : X% = +1
  83.     CASE %RIGHT_key, 54 :           X% = +1
  84.     CASE %LEFT_key , 52 :           X% = -1
  85.     CASE %END_key  , 49 : Y% = +1 : X% = -1
  86.     CASE %DOWN_key , 50 : Y% = +1
  87.     CASE %PGDN_key , 51 : Y% = +1 : X% = +1
  88.     CASE %CTRL_HOME     : Y% = -5 : X% = -5
  89.     CASE %CTRL_UP       : Y% = -5
  90.     CASE %CTRL_PGUP     : Y% = -5 : X% = +5
  91.     CASE %CTRL_LEFT     :           X% = -5
  92.     CASE %CTRL_RIGHT    :           X% = +5
  93.     CASE %CTRL_END      : Y% = +5 : X% = -5
  94.     CASE %CTRL_DOWN     : Y% = +5
  95.     CASE %CTRL_PGDN     : Y% = +5 : X% = +5
  96.     CASE %ENTER_key     : GBoxMOVE Lcol%, Trow%, -Wndo%
  97.     CASE %SPACE_key     : GboxMOVE Lcol%, Trow%, +Wndo%
  98.     CASE %ESC_key       : EXIT LOOP
  99.                           GBoxREST -1, -1, 0
  100.   END SELECT
  101. LOOP
  102.  
  103. BYEBYE:
  104.   CLS
  105.   GwndoCLOSE
  106.   SCREEN 0
  107.   END
  108.